package database;

import java.sql.SQLException;

/**
 *
 * @author mariam
 */
public class TestDataService {

    public static void main(String argv[]) throws SQLException {
        DataService ds = DataService.getInstance();
        Profile p1 = new Profile("Mariam", "Kadoura", "javamylove");
        Profile p2 = new Profile("Vincent", "Baena", "javamerde");
        Profile p3 = new Profile("admin2", "admin2", "adminadmin", true);
        Profile p4 = new Profile("Guigui", "Couicouin", "spain", "guigui@gmail.com");
        System.out.println(ds.insertProfile(p1));
        System.out.println(ds.insertProfile(p2));
        System.out.println(ds.insertProfile(p3));
        System.out.println(ds.insertProfile(p4));
        System.out.println(ds.setStatus(p1, Profile.Status.CONNECTED));
        System.out.println(ds.setStatus(p2, Profile.Status.BUSY));
        System.out.println(ds.setEmail(p1, "mariam.kadoura@gmail.com"));
        System.out.println(ds.setPassword(p2, "kikoulol"));
        //System.err.println(ds.deleteProfile(p2));
        System.out.println(ds.selectAllProfiles());
        //System.out.println(ds.insertPendingFriendship(p1, p2));
        //System.err.println(ds.getPendingFriendship(p2));
        //ds.acceptFriendship(p1, p2);
        //System.out.println(ds.insertPendingFriendship(p3, p2));
        //System.out.println(ds.deleteFriendship(p1, p2));
        /*System.out.println("Mariam is admin: " + ds.isAdmin(p1));
        System.out.println("admin2 is admin: " + ds.isAdmin(p3));
        System.out.println("Guigui has password 'spain': " + ds.correctPassword("guigui.couicouin", "spain"));
        System.out.println("Guigui has password 'n7': " + ds.correctPassword("guigui.couicouin", "n7"));
        System.out.println("Admin has password 'adminadmin': " + ds.correctPassword("admin", "adminadmin"));
        System.out.println("Vincent has password 'javaforever': " + ds.correctPassword("vincent.baena", "javaforever"));
        System.out.println("Entered 'dmi' for a research by login : " + ds.searchFriendByLogin("dmi"));
        System.out.println("Entered 'baena' for a research by login : " + ds.searchFriendByLogin("baena"));
        System.out.println(ds.searchFriendByEmail("mariam"));
        System.out.println(ds.searchFriendByLastName("Kadoura"));*/
        //ds.dropAllTables();
        ds.incrementNbConnections(p4);
        ds.incrementNbConnections(p2);
        System.err.println("Nb de connections (attendu 2) : " + ds.getNbConnections());
    }
}
